package com.lm.scau.dyb.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Function:
 * auth：liming on 2016/8/16 10:04
 * mail：liming@wxchina.com
 */
public class PhoneUtil {
    /**
     * 是不是电话号码的正则表达式
     * @param mobiles
     * @return
     */
    public static boolean isMobileNO(String mobiles) {
        Pattern p = Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");
        Matcher m = p.matcher(mobiles);
        System.out.println(m.matches() + "---");
        return m.matches();
    }
    public static boolean isPwdlegal(String pwd){
        Pattern p = Pattern.compile("((?=.*\\d)(?=.*\\D)|(?=.*[a-zA-Z])(?=.*[^a-zA-Z]))^.{6,15}$");
        Matcher m = p.matcher(pwd);
        System.out.println(m.matches() + "---");
        return m.matches();
    }
}
